<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <script defer type="module" src="index.js"></script>
  <script defer type="module">
    // eslint-disable-next-line unicorn/import-index
    import { useDebounced, useThrottle } from './index.js';

    const handleDebouncedClick = useDebounced(() => {
      console.log('click');
    }, 1000);

    const handleThrottleClick = useThrottle(() => {
      console.log('click');
    }, 1000);

    document
      .querySelector('#debounced')
      .addEventListener('click', handleDebouncedClick);

    document
      .querySelector('#throttle')
      .addEventListener('click', handleThrottleClick);
  </script>

  <body>
    <button id="debounced">debouncedButton</button>
    <button id="throttle">handleThrottleClickButton</button>
  </body>
</html>
